<?php
namespace app\admin\controller;

class Order extends Adm
{
	use \app\admin\traits\Curd;
    public function index()
    {
    	return $this->fetch();
    }
    public function set()
    {
        return $this->fetch();
    }
    public function upload()
    {
    	$file = $this->request->file('file');
    	return $this->saveFile($file,'goods');
    }
    public function lists()
    {
        //header('Content-Type:application/json;charset:utf-8');
        $count = 50;
        $p = 1;
        $l = 10;
        $o = new \app\admin\model\Order();
        $data = $o->with(['ordergoods' => function($query) {
            $query->field('*');
        }])->select();
        $this->code = 0;
        $this->assign(get_defined_vars());
        return $this->fetch();
    }
}
